
import type { url } from 'inspector';
<!-- Author:Rain -->
<template>
    <div class="new-guide-common__cont">
        <div class="new-guide-common__title"> 求职期望 2/6 </div>
        <div class="new-guide-common__progress">
            <div class="new-guide-common__progress-inner" style="width: 164px;"></div>
        </div>
        <div class="page-loading" style="display: none;">正在加载中...</div>
        <div class="new-guide-job-info">
            <form autocomplete="off" class="ui-form ui-form-label-top">
                <div class="resume-expectation-city-cascader form-item form-item-required">
                    <div class="item-label">你理想的工作城市是</div>
                    <div class="item-content">
                        <div class="city-cascader" ka="expect-city">
                            <div class="ui-cascader">
                                <div class="ui-cascader-selection">
                                    <div class="city-input input-wrap input-wrap-text">
                                        <!----><!----><input autocomplete="on" spellcheck="false" type="text"
                                            placeholder="选择理想工作的城市" v-model="guide.city" class="input"><!----><span class="suffix"><svg
                                                aria-hidden="true" class="svg-icon" style="width: 10px; height: 6px;">
                                                <use xlink:href="#icon-guide-arrow-down"></use>
                                            </svg></span><!----><!---->
                                    </div>
                                </div>
                            </div>
                        </div><!---->
                    </div>
                </div>
                <div class="form-item form-item-required" ka="expect-position">
                    <div class="item-label">你的期望职位是</div>
                    <div class="item-content">
                        <div class="input-wrap input-wrap-text" ka="resume_form_edit_position">
                            <!----><!----><input v-model="guide.pos" autocomplete="on" spellcheck="false" type="text" placeholder="选择感兴趣的方向"
                                class="input"><!----><span class="suffix"><svg aria-hidden="true" class="svg-icon"
                                    style="width: 10px; height: 6px;">
                                    <use xlink:href="#icon-guide-arrow-down"></use>
                                </svg></span><!----><!---->
                        </div><!----><!---->
                    </div>
                </div><!----><!---->
            </form><!----><!---->
        </div>
    </div>
</template>

<script setup lang="ts">
let guide=reactive({
    city:"",
    pos:""
})

onActivated(() => {
  // 调用时机为首次挂载
  // 以及每次从缓存中被重新插入时
  let guideInfo=JSON.parse(localStorage.getItem("guideInfo") as string)
  //去本地存储中把数据取出来！！！
  let {"guide-2":guide2}=guideInfo
  guide.city=guide2.city
guide.pos=guide2.pos
})


onDeactivated(() => {
//写入本地存储
  let guideInfo=JSON.parse(localStorage.getItem("guideInfo") as string)
  guideInfo["guide-2"]={
    city:guide.city,
    pos:guide.pos
  }
  localStorage.setItem("guideInfo",JSON.stringify(guideInfo))
})



</script>

<style scoped>
@import url("@/assets/guideCommon.css");

.ui-cascader {
    width: 492px;
    box-sizing: border-box;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.5;
}

.new-guide .form-item .item-content .ui-cascader,
.new-guide.form-item .item-content .ui-cascader .ui-cascader-selection {
    width: 100%;
}

.ui-cascader,
.ui-cascader-selection {
    display: inline-block;
    position: relative;
}

.new-guide .form-item .item-content .input-wrap input.input {
    width: 492px;
}
</style>